<script setup lang="ts">
const props = defineProps(['show'])
const emit = defineEmits(['close', 'sure'])

const resData = reactive({
  bonus: '0',
})

watch(props.show, (newVal) => {
  if (!newVal) {
    return
  }
  apo.activity.claimActivityReward(50, (error: any, data: any) => {
    if (error) {
      apo.logger.error('claimActivityReward error:', error)
      return
    }
    resData.bonus = data.bonus
  })
})
</script>

<template>
  <CommonResultDialog
    :show="show"
    :title="$t('activity.common.voce_venceu')"
    :desc="$t('activity.common.voce_venceu_desc')"
    :btn="$t('activity.common.confirmar')"
    :amount="resData.bonus"
    icon="/images/activity/common/Coin_Bg 1.png"
    @close="emit('close')"
    @sure="emit('close')"
  />
</template>

<style scoped lang="scss">

</style>
